package Map;

import java.util.Objects;

class Person {
    public String id;

    public Person(String id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id='" + id + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return Objects.equals(id, person.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
public class TestDemo {
    public static void main(String[] args) {
        Person p1 = new Person("12345");
        Person p2 = new Person("12345");
        System.out.println(p1.hashCode());
        System.out.println(p2.hashCode());

        HashBuck2<Person,Integer> hashBuck2 = new HashBuck2<>();
        hashBuck2.put(p1,10);

        System.out.println(hashBuck2.get(p2));
    }

    public static void main1(String[] args) {
        HashBuck hashBuck = new HashBuck();
        hashBuck.put(1,6);
        hashBuck.put(2,7);
        hashBuck.put(3,8);
        hashBuck.put(4,54);
        hashBuck.put(5,66);
        hashBuck.put(6,234);
        hashBuck.put(15,888);
        System.out.println(hashBuck.get(6));
    }
}
